#compiles the os

#the the bootfile
gcc -m32 -c -o ./bin/boot.o ./asm/boot.S
gcc -m32 -c -o ./bin/interrupt_asm.o ./asm/interrupt.S

#the libs
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/mytime.o ./lib/mytime.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/printThings.o ./lib/printThings.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/interrupt.o ./lib/interrupt.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/gdt.o ./lib/gdt.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/ports.o ./lib/ports.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/keyboard.o ./lib/keyboard.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/floppy.o ./lib/floppy.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/memory.o ./lib/memory.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/filesystem.o ./lib/filesystem.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/string.o ./lib/string.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/multitasking.o ./lib/multitasking.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/elf.o ./lib/elf.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/sharedMem.o ./lib/sharedMem.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/kernelWork.o ./lib/kernelWork.c
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/syscalls.o ./lib/syscalls.c


#the kernel
gcc -m32 -Wall -c -ffreestanding -nostdlib -fno-builtin -nostdinc -I ./lib/header/ -o ./bin/tkernel.o tkernel.c

#link it!
ld -melf_i386 -Tkernel.ld ./bin/syscalls.o ./bin/kernelWork.o ./bin/sharedMem.o ./bin/string.o ./bin/elf.o ./bin/multitasking.o ./bin/filesystem.o ./bin/memory.o ./bin/floppy.o ./bin/ports.o ./bin/interrupt_asm.o ./bin/keyboard.o ./bin/interrupt.o ./bin/boot.o ./bin/mytime.o ./bin/printThings.o ./bin/tkernel.o ./bin/gdt.o -o kernel -Map kernel.map

#disasemble it
objdump -d kernel > kernel.dis
